package me.spring.cloud.common.components.number.generator;

import me.spring.cloud.common.components.number.rule.domain.BillNumberProperties;
import me.spring.cloud.common.components.number.rule.loader.NumberRuleLoader;
import me.spring.cloud.common.components.util.json.JsonUtil;

/**
 * 规则加载器，使用方法配置
 *
 * @author Michael
 */
public class StaticNumberRuleLoader implements NumberRuleLoader {

  /**
   * 加载规则
   *
   * @Return
   */
  @Override
  public BillNumberProperties load() {
    String str = BillNumRuleSetting.RULES.replaceAll("'", "\"");
    return JsonUtil.parseJson(str, BillNumberProperties.class);
  }
}
